﻿ <%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true" CodeBehind="Student.aspx.cs" Inherits="ESCHOOL.admin.WebForm3" Title="Student" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style3
        {
            width: 92%;
            height: 682px;
        }
        .style4
        {
            width: 141px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <p style="text-align: right">
        <br />
    </p>
    <p>
        &nbsp;</p>
    
    <table style="width:100%">
        <tr>
                <td class="style4">
                    &nbsp;</td>
                <td>
                    <asp:TextBox ID="tbstudentid" runat="server" Visible="False"></asp:TextBox>
                    <asp:TextBox ID="tbregistration" runat="server" Visible="False"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Enrollment No</td>
                <td>
                    <asp:TextBox ID="tbenroll" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Roll No</td>
                <td>
                    <asp:TextBox ID="tbroll" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Class</td>
                <td>
                    <asp:DropDownList ID="ddclass" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Year Of Studing</td>
                <td>
                    <asp:DropDownList ID="ddyearstuding" runat="server">
                        <asp:ListItem>2000</asp:ListItem>
                        <asp:ListItem>2001</asp:ListItem>
                        <asp:ListItem>2002</asp:ListItem>
                        <asp:ListItem>2003</asp:ListItem>
                        <asp:ListItem>2004</asp:ListItem>
                        <asp:ListItem>2005</asp:ListItem>
                        <asp:ListItem>2006</asp:ListItem>
                        <asp:ListItem>2007</asp:ListItem>
                        <asp:ListItem>2008</asp:ListItem>
                        <asp:ListItem>2009</asp:ListItem>
                        <asp:ListItem>2010</asp:ListItem>
                        <asp:ListItem>2011</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Student Name</td>
                <td>
                    <asp:TextBox ID="tbstudname" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Date Of Birth</td>
                                <td>
                                    <asp:DropDownList ID="dddate" runat="server" 
                                        onselectedindexchanged="dddate_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddmonth" runat="server" 
                                        onselectedindexchanged="ddmonth_SelectedIndexChanged">
                                        <asp:ListItem Value="1">Jan</asp:ListItem>
                                        <asp:ListItem Value="2">Feb</asp:ListItem>
                                        <asp:ListItem Value="3">Mar</asp:ListItem>
                                        <asp:ListItem Value="4">Apr</asp:ListItem>
                                        <asp:ListItem Value="5">May</asp:ListItem>
                                        <asp:ListItem Value="6">Jun</asp:ListItem>
                                        <asp:ListItem Value="7">Jul</asp:ListItem>
                                        <asp:ListItem Value="8">Aug</asp:ListItem>
                                        <asp:ListItem Value="9">Sep</asp:ListItem>
                                        <asp:ListItem Value="10">Oct</asp:ListItem>
                                        <asp:ListItem Value="11">Nov</asp:ListItem>
                                        <asp:ListItem Value="12">Dec</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddyear" runat="server" 
                                        onselectedindexchanged="ddyear_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
            </tr>
        <tr>
                <td class="style4">
                    Gender</td>
                <td>
                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" Height="16px" 
                        RepeatDirection="Horizontal" Width="227px">
                        <asp:ListItem Value="f">Female</asp:ListItem>
                        <asp:ListItem Value="m">Male</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Photo</td>
                <td>
                    <asp:FileUpload ID="FileUpload1" runat="server" />
                    <asp:TextBox ID="TextBox1" runat="server" Visible="False"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Permanent Address</td>
                <td>
                    <asp:TextBox ID="tbpaddess" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Residence No</td>
                <td>
                    <asp:TextBox ID="tbrespno" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Mobile No</td>
                <td>
                    <asp:TextBox ID="tbmobile" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    Student Email Id</td>
                <td>
                    <asp:TextBox ID="tbstudmail" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    User Type</td>
                <td>
                    <asp:DropDownList ID="ddusertype" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    <asp:Label ID="labusername" runat="server" Text="Username"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbusername" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    <asp:Label ID="labpassword" runat="server" Text="Password"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbpassword" runat="server"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    &nbsp;</td>
                <td>
                    <asp:TextBox ID="tbques" runat="server" Visible="False"></asp:TextBox>
                    <asp:TextBox ID="tbanswer" runat="server" Visible="False"></asp:TextBox>
                </td>
            </tr>
        <tr>
                <td class="style4">
                    <asp:Button ID="btninsert" runat="server" onclick="btninsert_Click" 
                        Text="Insert" />
                </td>
                <td>
                    <asp:Button ID="btnupdate" runat="server" onclick="btnupdate_Click" 
                        Text="Update" />
                </td>
            </tr>
        <tr>
            <td colspan="2">
                <br />
            </td>
        </tr>
        <tr>
            <td class="style4">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;</td>
        </tr>
    </table>
    
    <p>
    </p>
                <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto">
                    <br />
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
                        AllowPaging="true" onpageindexchanging="GridView1_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="enrollment_no" HeaderText="Enrollment No" />
                            <asp:BoundField DataField="roll_no" HeaderText="Roll No" />
                            <asp:BoundField DataField="class_name" HeaderText="Class" />
                            <asp:BoundField DataField="student_name" HeaderText="Student Name" />
                            <asp:TemplateField HeaderText="Date of Birth">
                                <ItemTemplate>
                                    <%#Eval("date_of_birth","{0:d}") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Year of Studing">
                                <ItemTemplate>
                                    <%#Eval("year_of_studing","{0:d}") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="gender" HeaderText="Gender" />
                            <asp:TemplateField HeaderText="Photo">
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" Height="79px" 
                                        ImageUrl='<%# "~/admin/student/"+Eval("photo") %>' Width="71px" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="permanent_address" HeaderText="Address" />
                            <asp:BoundField DataField="residence_pno" HeaderText="Phone No(R)" />
                            <asp:BoundField DataField="mobile_no" HeaderText="Mobile No" />
                            <asp:BoundField DataField="student_emailid" HeaderText="Student email id" />
                            <asp:TemplateField HeaderText="Edit">
                                <ItemTemplate>
                                    <asp:Button ID="btnedit" runat="server" 
                                        CommandArgument='<%# Eval("student_id") %>' CommandName="Edit" 
                                        oncommand="btnedit_Command" Text="Edit" CausesValidation="False" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <ItemTemplate>
                                    <asp:Button ID="btndelete" runat="server" 
                                        CommandArgument='<%# Eval("student_id") %>' CommandName="Delete" 
                                        oncommand="btndelete_Command" Text="Delete" CausesValidation="False" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" 
                                        NavigateUrl='<%# "ParentInfo.aspx?id="+Eval("student_id") %>' 
                                        Text="Parent Info"></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
    </asp:Panel>
            </asp:Content>
